home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part1 / 1084 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  5.6 KB

  1. Path: homer.louisville.edu!krsear01
  2. From: krsear01@homer.louisville.edu (Kendall R. Sears)
  3. Newsgroups: comp.sys.amiga.misc
  4. Subject: Re: OS features
  5. Date: 11 Jan 1996 20:51:58 GMT
  6. Organization: University of Louisville, Louisville KY USA
  7. Message-ID: <4d3t9e$mkv@hermes.louisville.edu>
  8. References: <92747544038@PAPA.NORTH.DE> <4b3h9s$1st@alterdial.UU.NET> <hmAVx*Y3f@yaps.rhein.de> <cg.75pf@ami-cg.GraySage.Edmonton.AB.CA>
  9. NNTP-Posting-Host: homer.louisville.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. > There are other aspects of the philosophy of AmigaOS that can be preserved
  13. > in a memory-protected rewrite of it.
  14.  
  15. > I also don't think it would be terribly hard to change a lot of software
  16. > to work within a protected environment. I for one am quite careful to
  17. > always set mn_Length - I hope other programmers are similarly careful.
  18.  
  19. > Devices and handlers can all run "under the line", and retain full
  20. > access to the real address space (or a common virtual one). Message
  21. > copying only has to happen to/from user-mode code. Ignore MEMF_PUBLIC.
  22. > How hard is it to do changes like that? You don't have to change the
  23. > structure of the program, and likely not any of its philosophy.
  24.  
  25. > Come on, lets discuss this, folks!
  26.  
  27. I usually just lurk but this one has prompted me to respond.  I have watched
  28. discussions about the pros/cons of MP and AmigaOS both on usenet and bix for
  29. what seems forever (at least since v1.1.)  One thing that always bothered me
  30. about the discussions was that everyone covered the subject as a 
  31. "all-or-nothing" deal.  Arguments against ranged from "most software would die"
  32. to "it (MP) would slow the system down."  Arguments for usually ranged from
  33. "the user doesn't like the system crashing" to "it'd help developers find
  34. errors."  This message is one of the few that covered the possibility of
  35. partial protection.
  36.  
  37. Most who know anything about the internals of AmigaOS know that there are 
  38. several parts of the OS that assume that all memory is available.  Since most
  39. crashes are not caused by the OS but by user programs a partial protection
  40. should stop most crashes on machines with MMU's (68000's would still be
  41. unprotected).
  42.  
  43. What I propose is a system to segregate the system memory into 3 parts:
  44.   1) an area for the OS that is protected from writes by user processes
  45.   2) an area for user code that is write protected
  46.   and
  47.   3) a "public" area where the data segments of programs are stored as well
  48.      as message ports, and other data that need to be accessed by multiple
  49.      programs.
  50.  
  51. These areas need not be contiguous, nor do they need to be allocated at system
  52. start.  Use of the mem pools routines would provide a mechanism for 
  53. (de)allocation.  Each memory section would have a header that would tag that
  54. area so that ownership could be determined.  Area 1 would be protected while
  55. user programs are active and be made writable when the OS proper is active
  56. (as would all system memory). Area(s) 2 would be write-protected while other
  57. user programs are active and open when the owner process is active.  Area 3 
  58. would writable always.
  59.  
  60. Obviously, if a rogue program goes tromping through area 3 data could be
  61. corrupted, but correctly written programs check packet validity upon receipt
  62. to their port(s) and should be able to reject bad data, in the case where they
  63. don't they could only trash themselves since everything else is protected. 
  64. Bad writes to volitile data in area 3 would be more dangerous.
  65.  
  66. One of the most used arguments against MP is that IPC relies on sharing of
  67. memory.  Use of the above could provide a solution for this.  When
  68. an OS legal program creates a message port, most of the time calls to OS 
  69. routines are used to create the port (via CreateMsgPort in v36 and above and
  70. CreatePort from amiga.lib <v36.)  Changing those routines to use area 3 for 
  71. the ports would allow for message passing since user programs only get an 
  72. address to the port anyway.
  73.  
  74. Obviously, use of the MMU to change the status of memory sections will create
  75. some slowdown, but since most, if not all, changes will occur with a context
  76. switch this probably won't be noticed.
  77.  
  78. We could even take this a little farther... Assume that an Area 3 is set up
  79. for each process, when a process disappears (for any reason) the OS could
  80. call a DeletePool() on the area to recover most allocated memory (assuming,
  81. of course, that AllocMem() et al. is changed to call the pool functions.)
  82. The OS could either use an age mechanism or a task that occasionally runs
  83. the pools looking for headers that contain ids that no longer exist.
  84.  
  85. Now, we have the case where we have an older program that, while not illegal,
  86. isn't quite clean.  When the program tries to access a protected area that
  87. it owns, a requestor would be presented to the user asking whether to allow
  88. the access, suspend the program, or make all areas related to the process
  89. "public".
  90.  
  91. This scheme wouldn't keep everything from crashing, nor would it be 100%
  92. compatible, but I believe that it'd work and make the system much more
  93. stable without significant speed penalties.
  94.  
  95. Kendall.
  96. --
  97. Kendall Sears               krsear02@ulkyvx.louisville.edu            ///
  98. Programmer                                                           ///
  99. Child Development Unit      What the Fool cannot understand he   \\\///
  100. Department of Pediatrics    laughs at; thinking by laughter he    \XX/ Amiga
  101. University of Louisville    shows superiority, instead of latent   Certified
  102.                             idiocy.  - The Magic of Believing.     Developer
  103. ----------------------------------------------------------------------------
  104. Life is a game you play once.  In order to win you must make a difference.
  105.              Remember:  This is not a practice session.
  106.  
  107.